fix: support viptela-* image naming in get_cml_sdwan_image_definition#146
Open
ken130480 wants to merge 1 commit into
Open
fix: support viptela-* image naming in get_cml_sdwan_image_definition#146ken130480 wants to merge 1 commit into
ken130480 wants to merge 1 commit into
Conversation
When SD-WAN images are registered in CML manually (via the REST API or UI) rather than through sdwan-lab setup, they often use the legacy viptela-* naming convention (e.g. viptela-vmanage-20.12.7.1) instead of the expected cat-sdwan-manager-20.12.7.1 format. The exact-match check then fails and sys.exit() fires with a misleading message even though the images are present under different IDs. Add a version-string fallback inside the else branch: if the cat-sdwan-* exact match misses, scan existing_image_definitions for any ID containing the requested software_version string. This matches viptela-* IDs as well as any other non-standard naming that embeds the version number. The fallback is non-breaking: exact match is tried first; the fallback only runs on a miss; the existing controller/validator version-decrement logic is preserved for the case where neither check succeeds. Validated in production: CML 2.10.0 with viptela-* images, sdwan-lab deploy 20.12.7.1 successfully onboards all four SD-WAN node types.
Contributor
|
hi @ken130480, it's hard to support manual image names as each user can configure a different name. You can convert the images in the UI or reupload using setup task. Since we've reworked the code, could you please update the PR? I can review it then. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When SD-WAN images are registered in CML manually (via the REST API or UI) rather than through
sdwan-lab setup, they often use the legacy viptela-* naming convention:viptela-vmanage-20.12.7.1viptela-smart-20.12.7.1viptela-edge-20.12.7.1-vbondviptela-edge-20.12.7.1The
get_cml_sdwan_image_definition()function constructs the expected ID as{node_definition}-{software_version}(e.g.cat-sdwan-manager-20.12.7.1) and does an exact match. If the images exist but use viptela-* IDs, the function raises:The
[]is misleading — the images are present, just under different IDs. The function finds zero available versions because it only lists IDs for the correctnode_definition_id, then tries to parse versions using thecat-sdwan-*prefix format, which does not match viptela-* IDs.Fix
Add a version-string fallback inside the
elsebranch. If the exact cat-sdwan-* ID is not found, scanexisting_image_definitionsfor any ID containing the requestedsoftware_versionstring. This matches viptela-* IDs (which embed the version number) as well as any other non-standard naming that includes the version.The fallback only activates when the primary exact match fails, so there is no behaviour change for standard deployments.
Testing
Validated in production: CML 2.10.0 with SD-WAN images registered using viptela-* IDs.
sdwan-lab deploy 20.12.7.1successfully finds all four image definitions (vManage, vSmart, vBond, vEdge) and proceeds to full lab deployment.Notes